<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<title>爱租网_我的点评</title>
	<link rel="icon" href="_img_/logo.ico"> 
	{css href="_js_/layui/css/layui.css"}
	{js href="_js_/jquery2.1.4.min.js"}
	{js href="_js_/layer/layer.js"}
	{js href="_js_/layui/layui.js"}
	{js href="_js_/jquery.validate.min.js"}
	{js href="_js_/jquery.form.js"}
	{js href="_js_/messages_zh.js"}
	<style>
		*{margin:0;padding:0;}
    .kong{margin-left:150px;margin-top:10px;}
    .main{margin-left:150px;}
    .main>div{margin:3px 0;}
    .main>div>i{margin-right:5px;}
    .main>div>span{margin-left:15px;font-size:16px;color:#555555;}
    .btn{background:#ff3366;margin:10px 50px;}
    hr{height:5px;}
	</style>
</head>
<body>
	{include file="public/myself_menu"}
  {notpresent name="data"}
  <div class="kong">
    您还未有租房记录！
  </div>
  {else}
  <div class="main">
    {volist name="data" id="vo"}
    <hr>
    <div>
      <i class="layui-icon">&#xe623;</i>序&nbsp;号：<span>{$key+1}</span>
    </div>
    <div>
      服&nbsp;务&nbsp;类&nbsp;型：<span>{$vo.sname}</span>
    </div>
    <div>
      地&nbsp;址：<span>{$vo.addr}</span>
    </div>
    <div>
      接&nbsp;单：
      {if condition="$vo.mid>0"}
      <span>{$vo.uname}</span>
      {else}
      <span>暂无</span>
      {/if}
    </div>
    <div>
      下&nbsp;单&nbsp;时&nbsp;间：<span>{$vo.requesttime}</span>
    </div>
    {if condition="$vo.sname=='贴心管家'"}
    <div>
      状&nbsp;态：
      <span>已结束</span>
    </div>
    <div>
      操&nbsp;作：
      <button href="javascript:;" class="layui-btn layui-btn-disabled layui-btn-small">订单完成</button>
    </div>
    {elseif condition="$vo.statu=='待接单'"}
    <div>
      状&nbsp;态：
      <span>{$vo.statu}</span>
    </div>
    <div>
      操&nbsp;作：
      <button href="javascript:;" name="cancel" value="{$vo.id}" class="layui-btn layui-btn-danger layui-btn-small">取消</button>
      <input type="hidden" value="cancel">
    </div>
    {elseif condition="$vo.statu=='已接单'"}
    <div>
      状&nbsp;态：
      <span>{$vo.statu}</span>
    </div>
    <div>
      操&nbsp;作：
      <button href="javascript:;" name="comment"value="{$vo.id}" class="layui-btn layui-btn-normal layui-btn-small">评价</button>
      <input type="hidden" value="comment">
    </div>
    {elseif condition="$vo.statu=='订单取消'"}
    <div>
      状&nbsp;态：
      <span>{$vo.statu}</span>
    </div>
    <div>
      操&nbsp;作：
      <button href="javascript:;" class="layui-btn layui-btn-disabled layui-btn-small">已取消</button>
    </div>
    {else}
    <div>
      状&nbsp;态：
      <span>{$vo.statu}</span>
    </div>
    <div>
      操&nbsp;作：
      <button href="javascript:;" class="layui-btn layui-btn-disabled layui-btn-small">订单完成</button>
    </div>
    {/if}
    {/volist}
  </div>
  {/notpresent}
</body>
</html>
<script type="text/javascript">

  $('button').click(function(){
    var data = 1;
    var id = $(this).val();
    var want = $(this).next().val();
    $.post('{:url('index/vip/want')}'+'?id='+id+'&want='+want,data,function(res){
      // console.log(res.msg);
      if(res.msg == id){
        layer.prompt({title:'评论'},function(value,index){
          var data = 'id='+res.msg+'&comment='+value;
          $.post('{:url('index/vip/do_comment')}',data,function(re){
            if(re.msg=='评论成功'){
              layer.msg(re.msg,{icon:1,time:1000},function(){layer.close(index)});
            }
          })
        });
      }
    })
  });

	layui.use('element', function(){
		  var element = layui.element;
		});
</script>